package com.sichemxiang.controller;

import com.sichemxiang.entity.AnswerResultDto;
import com.sichemxiang.entity.ChatMessageDto;
import com.sichemxiang.service.AnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

/**
 * @Author: xsz
 * @DateTime: 2025/1/14 0:15
 **/


@RestController
@RequestMapping("/answer")
public class AnswerController {

    @Autowired
    private AnswerService answerService;

    @PostMapping("/chat")
    public AnswerResultDto answer(@RequestBody ChatMessageDto chatMessageDto) throws IOException {
        return answerService.answer(chatMessageDto);
    }

    @GetMapping("/test")
    public String test() {
        return "hello world";
    }


}
